<?php
/**
 * Created by 项目.
 * User: xuguopeng
 * Date: 5/26/21
 * Time: 5:15 PM
 */

namespace app\api\model;

// 店员
use think\model\concern\SoftDelete;

class StoreUser extends BaseModel
{
    use SoftDelete;

    // 店面信息
    public function store()
    {
        return $this->belongsTo('Store','store_id','id');
    }

    // 分组信息
    public function group()
    {
        return $this->belongsTo('StoreGroup','group_id','id');
    }

    // 用户信息
    public function user()
    {
        return $this->belongsTo('User','user_id','id');
    }

    // 店列表
    public function items()
    {
        return $this->hasMany('StoreUserItem','store_user_id','id')->order('id asc');
    }
}